import ldap
l = ldap.initialize("ldap://localhost:389")
l.simple_bind("cn=admin,dc=erikin,dc=com","mypassword")
x = l.search_s("dc=erikin,dc=com", ldap.SCOPE_SUBTREE, "objectClass=*")
print x
